package com.mammoth.Bodybuilding.entity;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 
 * @title : RegionObj
 * @description : 区域表
 * @company : com.mammoth.Bodybuilding.entity
 * @project Mammoth
 * @author xingzhaojun
 * @date 2018年4月24日 下午11:01:50
 */
@Entity
@Table(name = "SYS_REGION")
public class RegionObj implements Serializable {

	/**
	 * 序列化
	 */
	private static final long serialVersionUID = -5562877465894606111L;
	/** 主键序号 **/
	@Id
	private Long id;
	/** 区域代码 **/
	private String region_code;
	/** 区域名称 **/
	private String region_name;
	/** 父id **/
	private Long fid;
	/** 区域拼音 **/
	private String region_name_en;
	/** 区域英文代码 **/
	private String region_shortname_en;
	/** 等级 **/
	private String level;
	
	/**
	 * 无参构造
	 */
	public RegionObj() {
		
	}
	/**
	 * 有参构造
	 * @param id 主键id
	 * @param region_code 区域代码
	 * @param region_name 区域名称
	 * @param fid 父id
	 * @param region_name_en 区域拼音
	 * @param region_shortname_en 区域英文代码
	 * @param level 等级
	 */
	public RegionObj(Long id, String region_code, String region_name, Long fid, String region_name_en,
			String region_shortname_en, String level) {
		super();
		this.id = id;
		this.region_code = region_code;
		this.region_name = region_name;
		this.fid = fid;
		this.region_name_en = region_name_en;
		this.region_shortname_en = region_shortname_en;
		this.level = level;
	}




	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getRegion_code() {
		return region_code;
	}

	public void setRegion_code(String region_code) {
		this.region_code = region_code;
	}

	public String getRegion_name() {
		return region_name;
	}

	public void setRegion_name(String region_name) {
		this.region_name = region_name;
	}

	public Long getFid() {
		return fid;
	}

	public void setFid(Long fid) {
		this.fid = fid;
	}

	public String getRegion_name_en() {
		return region_name_en;
	}

	public void setRegion_name_en(String region_name_en) {
		this.region_name_en = region_name_en;
	}

	public String getRegion_shortname_en() {
		return region_shortname_en;
	}

	public void setRegion_shortname_en(String region_shortname_en) {
		this.region_shortname_en = region_shortname_en;
	}

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((fid == null) ? 0 : fid.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((level == null) ? 0 : level.hashCode());
		result = prime * result + ((region_code == null) ? 0 : region_code.hashCode());
		result = prime * result + ((region_name == null) ? 0 : region_name.hashCode());
		result = prime * result + ((region_name_en == null) ? 0 : region_name_en.hashCode());
		result = prime * result + ((region_shortname_en == null) ? 0 : region_shortname_en.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		RegionObj other = (RegionObj) obj;
		if (fid == null) {
			if (other.fid != null)
				return false;
		} else if (!fid.equals(other.fid))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (level == null) {
			if (other.level != null)
				return false;
		} else if (!level.equals(other.level))
			return false;
		if (region_code == null) {
			if (other.region_code != null)
				return false;
		} else if (!region_code.equals(other.region_code))
			return false;
		if (region_name == null) {
			if (other.region_name != null)
				return false;
		} else if (!region_name.equals(other.region_name))
			return false;
		if (region_name_en == null) {
			if (other.region_name_en != null)
				return false;
		} else if (!region_name_en.equals(other.region_name_en))
			return false;
		if (region_shortname_en == null) {
			if (other.region_shortname_en != null)
				return false;
		} else if (!region_shortname_en.equals(other.region_shortname_en))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Region [id=" + id + ", region_code=" + region_code + ", region_name=" + region_name + ", fid=" + fid
				+ ", region_name_en=" + region_name_en + ", region_shortname_en=" + region_shortname_en + ", level="
				+ level + "]";
	}

}
